<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./JS/jQuery.min.js"></script>
</head>

<body>
    <!--  向服务器提交数据
    $.post(url,[data],[callback]) string object function -->

    <button class="btn">发起post请求</button>
    <script>
        $(function () {
            $('.btn').on('click', function () {
                $.post('https://ajax-base-api-t.itheima.net/api/addbook', { bookname: '水浒传', author: '施耐庵', publisher: '上海图书出版社' }, function (res) {
                    console.log(res);
                })
            })
        })

    </script>
</body>

</html>